class NoticeListController{
    constructor($rootScope,$scope,$sce,UserService,AccountService){
        Object.assign(this,{$rootScope,$scope,$sce,UserService,AccountService});
        this.noticeList();
    }

    /**
     * 获取公告列表
     */
    noticeList(){
        let self = this;
        self.AccountService.getNoticeInfo({ignoreLoadingBar:true}).then(_success).catch(_error);
        function _success(data) {
            // if(data.success==true){
            self.data = data.data;
            console.log(JSON.stringify(self.orderData));
            // }
        }
        function _error(reason) {
            console.log(JSON.stringify(reason));
            // layer.alert(reason&&reason.text?reason.text:"对不起操作失败！",{
            //     title:"错误",
            //     icon: 2,
            //     btn:["知道了"],
            //     btn1:function (index,layerro) {
            //         layer.close(index);
            //     }
            // });
        };
    }
    showDetail(title,content){
        layer.open({
               title:title,
               content:content,
               btn:["关闭"],
               yes:function (index,layerno) {
                   layer.close(index);
               }
           });
    }
}
NoticeListController.$inject = ["$rootScope","$scope","$sce","UserService","AccountService"];

export default NoticeListController;